package com.sky.controller.user;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 褚金龙
 * @Date 2024/9/7 1:43
 */

@Slf4j
@RestController
@RequestMapping("/user")
@CrossOrigin("*")
/**
 * 设置店铺的营业状态
 */
@Api(tags = "营业状态设置")
public class ShopController {
    public  static final String KEY="SHOP_STATUS";
    @Autowired
    private RedisTemplate redisTemplate;



    @GetMapping("/shop/status")
    @ApiOperation("营业状态查询")
    public  Result queryStatus(){
        ValueOperations valueOperations = redisTemplate.opsForValue();
        Integer status = (Integer) valueOperations.get(KEY);
       // log.info("status{}",status);
        return Result.success(status);

    }
}
